<?php

namespace App\Http\Requests;

use App\Http\Requests\BaseFormRequest;

class PermissionRequest extends BaseFormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

	public function scenes()
    {
        return [
            'store'=>[
				'name' => 'required|unique:abilities|max:155',
				'title' => 'required|max:255',
			],
			'update'=>[
				'name' => 'required|unique:abilities,name,'.$this->input('id').'|max:155',
				'title' => 'required|max:255',
			]
        ];
    }
	
	public function messages()
    {
        return [
			'name.required' => '权限名称必须',
			'name.unique' => '权限名称已经存在',
			'name.max' => '权限名称不能超过155个字符',
			'title.required' => '权限描述必须',
			'title.max' => '权限描述不能超过255个字符',
        ];
    }
	
	public function withValidator($validator)
	{

	}
}
